package com.benefm.multipar.pad.ui;

import android.content.pm.ActivityInfo;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.benefm.multipar.pad.view.LoadingDialog;

public class BaseActivity extends AppCompatActivity {

    public LoadingDialog dialogLoading;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        dialogLoading = new LoadingDialog(this);
    }


    protected void showLoading() {
        if (dialogLoading != null && !dialogLoading.isShowing() && !isFinishing())
            dialogLoading.show();
    }

    protected void hideLoading() {
        if (dialogLoading != null && dialogLoading.isShowing() && !isFinishing())
            dialogLoading.dismiss();
    }

}
